#include <iostream>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    long long stairs[41] = {0};
    int i, N;
    stairs[1] = 0;
    stairs[2] = 1;
    stairs[3] = 2;
    for (i = 4; i < 41; i++)
    {
        stairs[i] = stairs[i - 1] + stairs[i - 2];
    }
    cin >> N;
    while (N--)
    {
        cin >> i;
        cout << stairs[i] << endl;
    }
    return 0;
}